import e
import botpy
from botpy.user import Member
from botpy.types.message import Message

class dirtmesg2:

    def priority(self):#优先级
        return 1

    def should_trigger(self,  member: Member,event):
        # 判断是否触发插件逻辑的条件
             return event == 2 or 3

    async def execute(self,  member: Member, api,event):
        if(event == 2):   #如果事件为新增成员
            about_guild=await e.getMember(api,member)
            print(f"频道用户:{about_guild['username']}({about_guild['userId']}) 加入了频道：{about_guild['guildName']}")
        elif (event == 3):  #如果事件为退出成员
            about_guild = await e.getMember(api,member)
            print(f"频道用户:{about_guild['username']}({about_guild['userId']}) 退出了频道：{about_guild['guildName']}")
        return False